package com.th.supcom.pds.impl.service.internal.phamapply;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.th.supcom.pds.domain.pojo.InpPhamApplyPatInfo;

/**
 * @author yzhang
 */
public final class InpPhamPatInfoConvertUtils
{
    private InpPhamPatInfoConvertUtils ()
    {

    }

    /**
     * 将患者列表按照患者流水号分类
     * 
     * @param detailList
     * @return
     */
    public static Map <Long, InpPhamApplyPatInfo> convertListToMapByPatVisitId (List <InpPhamApplyPatInfo> detailList)
    {
        Map <Long, InpPhamApplyPatInfo> map = new HashMap <Long, InpPhamApplyPatInfo> ();
        for (InpPhamApplyPatInfo inpPhamApplyPatInfo : detailList)
        {
            InpPhamApplyPatInfo temp = null;

            if (map.containsKey (inpPhamApplyPatInfo.getPaiVisitId ()))
            {
                temp = map.get (inpPhamApplyPatInfo.getPaiVisitId ());
            }
            else
            {
                temp = new InpPhamApplyPatInfo ();
            }
            temp = inpPhamApplyPatInfo;
            map.put (inpPhamApplyPatInfo.getPaiVisitId (), temp);
        }
        return map;
    }
}
